package cn.nebula.music.converter;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.convert.converter.Converter;
import org.springframework.stereotype.Component;

import cn.nebula.music.dao.RoleDAO;
import cn.nebula.music.domain.Role;

@Component
public class StringToRoleConverter implements Converter<String,Role>{

	
	@Autowired
	private RoleDAO roleDAO;
	
	@Override
	public Role convert(String source) {
		return roleDAO.findRoleById(Integer.valueOf(source)) ;
	}

}
